home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Plus
/
Graphics Plus.iso
/
sgi
/
editors
/
kali.lha
/
kali
/
symmetry.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-25
|
2KB
|
116 lines
/* */
/*** symmetry.h - Nina Amenta, Aug. 1989 ****/
/* */
#define NUM_SYM 17
#define P3 0
#define P2 1
#define P1 2
#define PG 3
#define PGG 4
#define PMG 5
#define PM 6
#define CM 7
#define PMM 8
#define CMM 9
#define P31M 10
#define P3M1 11
#define P4 12
#define P4G 13
#define P4M 14
#define P6 15
#define P6M 16
#ifndef FALSE
#define FALSE 0
#endif
#define SX 0
#define SY 1
#define EX 2
#define EY 3
#define GLIDE 1
#define DRAW 1
#define CUT 2
#define PICK 3
#define TRANSFORM 4
#define MOVE 5
#define ZOOM 6
#define ANGLE 7
#define RATIO 8
#define ROTATE 9
#define DELETE 10
#define NAMESTACKSIZE 50
typedef struct point_t
{
float x;
float y;
} POINT;
typedef struct rectangle_t
{
float x;
float y;
float width;
float height;
} RECTANGLE;
typedef POINT VECTOR;
typedef struct sym_t SYMMETRY;
typedef struct s_line LINE;
typedef float MATRIX[4];
typedef MATRIX XFORM;
typedef long WINDOW;
typedef long EVENT;
typedef long MENU;
/* Bit flags for dof (degrees of freedom) field of symmetry definition */
#define RAT 1
#define ANG 2
struct sym_t
{
int dof;
VECTOR v1;
VECTOR v2;
int refl;
VECTOR reflections[2];
int glide;
int rot;
char *label;
};
struct s_line
{
MATRIX m;
short id;
short obj_pos;
LINE *next;
};
extern SYMMETRY SYMTAB[];
extern POINT ORIGIN;
#define RectIncludesPoint(r,p) \
(((p).x>=(r).x) && \
((p).y>=(r).y) && \
(((p).x<=(r).x+(r).width)) && \
(((p).y<=(r).y+(r).height)))
#define PointRightOfRect(p,r) \
(((p).x>(r).x+(r).width))
#define bump(src,dest,scale,vec) \
{ (dest)->x=(scale)*(vec)->x+(src)->x; (dest)->y=(scale)*(vec)->y+(src)->y; }